﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cxx.Entity;
using Cxx.IDAL;
using Cxx.IOC;

namespace Cxx.BLL
{
    public class Stock
    {
        private static readonly IStockDal dal = IocManager.Instance.ResolveIntance<IStockDal>();

        public static void Insert(List<StockInfo> infos)
        {
            dal.Insert(infos);
        }

        public static void Insert(StockInfo info)
        {
            dal.Insert(info);
        }

        public static void Update(StockInfo info)
        {
            dal.Update(info);
        }

        public static StockInfo Get(string receiver, string tradeName)
        {
            return dal.Get(receiver, tradeName);
        }

        public static List<StockInfo> Get(string receiver)
        {
            return dal.Get(receiver);
        }

        public static List<StockInfo> GetListForPage(string condition, int pageIndex, int pageSize, out int recordCount)
        {
            return dal.GetListForPage(condition, pageIndex, pageSize, out recordCount);
        }

        public static void Delete(List<int> ids)
        {
            dal.Delete(ids);
        }

        public static void Delete(string receiver)
        {
            dal.Delete(receiver);
        }
    }
}
